xen.git
14 years agoamd iommu: Introduces new helper functions to simplify bitwise operations
Wei Wang [Thu, 12 Jan 2012 12:49:34 +0000 (13:49 +0100)]
amd iommu: Introduces new helper functions to simplify bitwise operations

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agoamd iommu: Refactoring iommu ring buffer definition
Wei Wang [Thu, 12 Jan 2012 12:48:57 +0000 (13:48 +0100)]
amd iommu: Refactoring iommu ring buffer definition

Introduce struct ring_buffer to represent iommu cmd buffer, event log and ppr log

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agomove declarations of some required per-arch functions into common headers
Jan Beulich [Thu, 12 Jan 2012 12:45:47 +0000 (13:45 +0100)]
move declarations of some required per-arch functions into common headers

... since it is pointless to have each arch declare them on their own
(and now and the - see ia64 - forget to do so).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoia64: fix build (once again)
Jan Beulich [Thu, 12 Jan 2012 12:44:51 +0000 (13:44 +0100)]
ia64: fix build (once again)

24423:069c08b7de46 failed to add a necessary include, and for a long
time kexec.h suffered from a missing structure forward declaration.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agox86/mm: Code style fixes in mem_sharing.c
Andres Lagar-Cavilla [Thu, 12 Jan 2012 11:02:18 +0000 (11:02 +0000)]
x86/mm: Code style fixes in mem_sharing.c

No functional changes, only code style issues.

One small diff in mem_sharing_gref_to_gfn() looks like a logic change,
but it's not.  The flow was confusing, so it's been clarified.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Disable paging_prep
Andres Lagar-Cavilla [Thu, 12 Jan 2012 10:52:30 +0000 (10:52 +0000)]
x86/mm: Disable paging_prep

The only way to page-in a page is now the safe paging_load domctl.
(Unless the page was never paged out in the first place)

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86/mm: Allow a page in p2m_ram_paged_out state to be loaded
Andres Lagar-Cavilla [Thu, 12 Jan 2012 10:52:30 +0000 (10:52 +0000)]
x86/mm: Allow a page in p2m_ram_paged_out state to be loaded

This removes the need for a page to be accessed in order to be pageable
again. A pager can now page-in pages at will with no need to map them
in a separate thread.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agox86: add a new SMP bring up way for tboot case
Wei, Gang [Wed, 11 Jan 2012 09:34:45 +0000 (10:34 +0100)]
x86: add a new SMP bring up way for tboot case

From: Wei, Gang <gang.wei@intel.com>

tboot may be trying to put APs waiting in MWAIT loops before launching
Xen. Xen could check the new flag field in v6 tboot shared page for the
hint. If TB_FLAG_AP_WAKE_SUPPORT bit in flag field is set, Xen BSP have
to write the monitored memory(g_tboot_shared->ap_wake_trigger) to bring
APs out of MWAIT loops. The sipi vector should be written in
g_tboot_shared->ap_wake_addr before waking up APs.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agoxenpaging: convert mem_event_t to struct mem_event
Olaf Hering [Mon, 9 Jan 2012 16:07:32 +0000 (17:07 +0100)]
xenpaging: convert mem_event_t to struct mem_event

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoxenpaging: convert xenpaging_t to struct xenpaging
Olaf Hering [Mon, 9 Jan 2012 16:07:26 +0000 (17:07 +0100)]
xenpaging: convert xenpaging_t to struct xenpaging

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoxenpaging: convert xenpaging_victim_t to struct victim
Olaf Hering [Mon, 9 Jan 2012 16:07:21 +0000 (17:07 +0100)]
xenpaging: convert xenpaging_victim_t to struct victim

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoxenpm: assorted adjustments
Jan Beulich [Tue, 10 Jan 2012 16:24:50 +0000 (16:24 +0000)]
xenpm: assorted adjustments

- use consistent error values (stop mixing of [positive] errno values
  with literal -E... ones)
- properly format output
- don't use leading zeros in decimal output
- move printing of average frequency into P-state conditional (rather
  than a C-state one)
- don't print some C-state related info when CPU idle management is
  disabled in the hypervisor
- use calloc() for array allocations that also got cleared via memset()
  so far

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agodocs: xl.pod.1: introduction to FLASK
Stefano Stabellini [Tue, 10 Jan 2012 16:13:06 +0000 (16:13 +0000)]
docs: xl.pod.1: introduction to FLASK

Add a simple introduction to FLASK to the xl man page, at the beginning
of the FLASK chapter. Link to the xsm-flask.txt document.
Currently FLASK, TMEM and PCI PASS-THROUGH are defined as =head2 so they
look like sub-chapters of VIRTUAL DEVICE COMMANDS. Make them =head1.

Based on a text written by Daniel De Graaf.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: add feature flag to xenstore for XS_RESET_WATCHES
Olaf Hering [Thu, 5 Jan 2012 18:40:40 +0000 (19:40 +0100)]
libxl: add feature flag to xenstore for XS_RESET_WATCHES

Tell guest about availibilty of xenstoreds XS_RESET_WATCHES function.
Guests can not issue this command unconditionally because some buggy
toolstacks (such as EC2) do not ignore unknown commands properly.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoflask/policy: add missing manage_domain rules
Daniel De Graaf [Tue, 10 Jan 2012 16:04:26 +0000 (16:04 +0000)]
flask/policy: add missing manage_domain rules

The updated example policy did not include rules to allow managing the
created domains (pause, unpause, destroy); allow these actions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agodocs: Update xsm-flask documentation
Daniel De Graaf [Tue, 10 Jan 2012 16:04:25 +0000 (16:04 +0000)]
docs: Update xsm-flask documentation

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoblktap2/vhd: add -liconv when linking if using libiconv
Roger Pau Monne [Tue, 20 Dec 2011 07:31:40 +0000 (08:31 +0100)]
blktap2/vhd: add -liconv when linking if using libiconv

If libiconv is detected on the system add -liconv when linking the
libvhd library.

If -liconv is not added when compiling libvhd with libiconv the
following error occours when linking vhd-util and vhd-update:

gcc     -o vhd-util vhd-util.o -Llib -lvhd
lib/libvhd.so: undefined reference to `libiconv_open'
lib/libvhd.so: undefined reference to `libiconv_close'
lib/libvhd.so: undefined reference to `libiconv'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agobuild: detect if libiconv is present
Roger Pau Monne [Tue, 20 Dec 2011 07:31:40 +0000 (08:31 +0100)]
build: detect if libiconv is present

Detect if libiconv is present in the system, since we will have to
link against it when using iconv.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoblktap2: remove local definitions and include byteswap.h
Roger Pau Monne [Tue, 20 Dec 2011 07:31:40 +0000 (08:31 +0100)]
blktap2: remove local definitions and include byteswap.h

Use the same approach as tools/blktap2/include/libvhd.h, remove local
definitions of bswap* and include byteswap.h. Also remove the
HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
defined by QEMU).

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoblktap: remove local definitions and include byteswap.h
Roger Pau Monne [Tue, 20 Dec 2011 07:31:40 +0000 (08:31 +0100)]
blktap: remove local definitions and include byteswap.h

Use the same approach as tools/blktap2/include/libvhd.h, remove local
definitions of bswap* and include byteswap.h. Also remove the
HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
defined by QEMU).

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: VM generation ID save/restore and migrate.
Paul Durrant [Fri, 16 Dec 2011 14:54:14 +0000 (14:54 +0000)]
tools: VM generation ID save/restore and migrate.

Add code to track the address of the VM generation ID buffer across a
save/restore or migrate, and increment it as necessary.
The address of the buffer is written into xenstore by hvmloader at
boot time. It must be read from xenstore by the caller of
xc_domain_save() and then written back again by the caller of
xc_domain_restore().

Note that the changes to xc_save.c and xc_restore.c are merely
sufficient for them to build.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: Add hvm specific ro and rw nodes.
Paul Durrant [Fri, 16 Dec 2011 14:54:13 +0000 (14:54 +0000)]
libxl: Add hvm specific ro and rw nodes.

The hvmloader node was created by libxl__create_device_model() but it
needs to be moved earlier so that it can parent the new rw
generation-id-address node.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Open code rw and ro node creation.
Paul Durrant [Fri, 16 Dec 2011 14:54:13 +0000 (14:54 +0000)]
libxl: Open code rw and ro node creation.

Use a new libxl__xs_mkdir() to do this and also clean up extraneous
node creation while in the neighbourhood. Checking 'xenstore-ls -fp'
output before and after shows that, as well as the disappearance of
error, drivers, messages and domid, the following perms change is also
present:

-device/suspend = ""   (ndomU)
+device/suspend = ""   (n0,rdomU)

I believe the new perms are more desirable than the old ones.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoAdd correct const-ness to memshr tool functions
Andres Lagar-Cavilla [Tue, 10 Jan 2012 15:38:08 +0000 (15:38 +0000)]
Add correct const-ness to memshr tool functions

This patch addresses some of the compile and link issues with the memshr
module.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoFix types used in xc_memshr_* functions
Andres Lagar-Cavilla [Tue, 10 Jan 2012 15:38:08 +0000 (15:38 +0000)]
Fix types used in xc_memshr_* functions

Currently the memshr functions use uint32_t for the domid.  This actually leads
to a funny domid_t -> uint32_t -> domid_t sequence of casts.  This patch
updates the API functions to be domid_t in the first place.

No tools need to be modified with this patch, the casts were implicit.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxc: Only retry mapping pages when ENOENT is returned
Andres Lagar-Cavilla [Tue, 10 Jan 2012 15:35:01 +0000 (15:35 +0000)]
libxc: Only retry mapping pages when ENOENT is returned

If the return value from the ioctl() is not ENOENT, it's possible that err[i]
will not be updated and libxc will just loop forever.  Although it's unlikely
that err[i] would not be updated after the ioctl() gets through at least once,
it's better to be defensive.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoVMX: print Pause Loop Exiting disabled message just once
Jan Beulich [Mon, 9 Jan 2012 15:01:44 +0000 (16:01 +0100)]
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoPCI: properly abstract out per-architecture extensions to struct pci_dev
Jan Beulich [Mon, 9 Jan 2012 14:59:59 +0000 (15:59 +0100)]
PCI: properly abstract out per-architecture extensions to struct pci_dev

x86's used_vectors member was both misplaced (in struct pci_dev_info,
which acts as a hypercall input data passing container only) and
improperly abstracted (requiring a CONFIG_X86 conditional in a generic
header).

The adjustment requires hiding several more lines in IA64's pci.h, but
as a benefit this allows removing one of the "null" headers.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoPCI: shrink pci_dev_info's is_extfn/is_virtfn members
Jan Beulich [Mon, 9 Jan 2012 14:55:00 +0000 (15:55 +0100)]
PCI: shrink pci_dev_info's is_extfn/is_virtfn members

They are used as boolean flags only, so convert them accordingly
(shrinking the structure size by 8 bytes).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoUpdate QEMU_TAG
Ian Jackson [Thu, 5 Jan 2012 17:25:23 +0000 (17:25 +0000)]
Update QEMU_TAG

14 years agoipxe: remove tarball on clean
Ian Campbell [Thu, 5 Jan 2012 17:21:04 +0000 (17:21 +0000)]
ipxe: remove tarball on clean

This prevents us picking up a stale tarball when the tag changes.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agopygrub: fix extlinux parsing
Roger Pau Monne [Tue, 3 Jan 2012 12:11:46 +0000 (13:11 +0100)]
pygrub: fix extlinux parsing

pygrub was unable to parse extlinux config files correctly, exactly
the ones like:

LABEL grsec
  KERNEL vmlinuz-3.0.10-grsec
  APPEND initrd=initramfs-3.0.10-grsec
root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee
modules=sd-mod,usb-storage,ext4 xen quiet

This patch fixes it, adding a new case when parsing the "append" line,
that searches for the initrd image.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: write vifname in xenstore if set.
Wei Liu [Thu, 5 Jan 2012 17:13:33 +0000 (17:13 +0000)]
libxl: write vifname in xenstore if set.

Simple fix to enable user to specify vif names.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: print out vifname in create dryrun.
Wei Liu [Thu, 5 Jan 2012 17:13:33 +0000 (17:13 +0000)]
libxl: print out vifname in create dryrun.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agonetbsd: build fix with gcc 4.5
David Brownlee [Thu, 5 Jan 2012 15:51:28 +0000 (15:51 +0000)]
netbsd: build fix with gcc 4.5

Fix build failure with gcc 4.5:
implicit declaration of __builtin_stdarg_start

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
From: David Brownlee <abs@netbsd.org>
Committed-by: Keir Fraser <keir@xen.org>
14 years agox86: emulate lea with two register operands correctly
David Vrabel [Thu, 5 Jan 2012 15:47:16 +0000 (15:47 +0000)]
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoipxe: update to upstream version
Roger Pau Monne [Tue, 20 Dec 2011 07:21:11 +0000 (08:21 +0100)]
ipxe: update to upstream version

Updated ipxe to current tree, which is
540e5960dc6b49eacf367f7c319fd0546474b845:

Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 builds

Removed all the backported patches and updated
boot_prompt_option.patch to apply against current ipxe.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoxenpaging: remove _XOPEN_SOURCE
Roger Pau Monne [Thu, 5 Jan 2012 14:35:38 +0000 (14:35 +0000)]
xenpaging: remove _XOPEN_SOURCE

The _XOPEN_SOURCE define was breaking the compilation under NetBSD.
I've removed it becasue it is not necessary.

Error message:

gcc  -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing
-std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value
-Wdeclaration-after-statement   -D__XEN_TOOLS__ -MMD -MF
.xenpaging.o.d -fno-optimize-sibling-calls
-I/root/xen-04102011/tools/xenpaging/../../tools/libxc
-I/root/xen-04102011/tools/xenpaging/../../tools/include
-I/root/xen-04102011/tools/xenpaging/../../tools/xenstore
-I/root/xen-04102011/tools/xenpaging/../../tools/include -Werror
-Wno-unused -g  -c -o xenpaging.o xenpaging.c  -I/usr/xen42/include
-I/usr/include
cc1: warnings being treated as errors
xenpaging.c: In function 'xenpaging_init':
xenpaging.c:333: warning: implicit declaration of function 'asprintf'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86/vIRQ: IRR and TMR race condition bug fix
Yongan Liu [Thu, 5 Jan 2012 08:29:59 +0000 (09:29 +0100)]
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agoRework locking for sched_adjust.
Dario Faggioli [Wed, 4 Jan 2012 16:12:44 +0000 (16:12 +0000)]
Rework locking for sched_adjust.

The main idea is to move (as much as possible) locking logic
from generic code to the various pluggable schedulers.

While at it, the following is also accomplished:
 - pausing all the non-current VCPUs of a domain while changing its
   scheduling parameters is not effective in avoiding races and it is
   prone to deadlock, so that is removed.
 - sedf needs a global lock for preventing races while adjusting
   domains' scheduling parameters (as it is for credit and credit2),
   so that is added.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoAll domains (including dom0) should be best effort on creation
Dario Faggioli [Wed, 4 Jan 2012 16:11:46 +0000 (16:11 +0000)]
All domains (including dom0) should be best effort on creation

In the sedf scheduler, while trying to guarantee to dom0 the proper
amount of CPU time for being able to do its job, we end up allocating
75% CPU-share to each and every of its VCPUs. This, combined with the
fact that such a scheduler has no load balancing logic at all (and
thus *all* dom0's VCPUs just rise and stay on physical CPU #0), means
that for example on a 12-cores system we're trying to exploit
75x12=3D900% of what we have on a PCPU, which is definitely too much!

Moreover, even if a cleverer mechanism for distributing VCPUs among
the available PCPUs (if not a proper load balancer) will be put in
place some day, it will still be difficult to decide how much
guaranteed CPU bandwidth each of the dom0's VCPUs should be provided
with, without posing the system at risk of livelock or starvation,
even during boot time.

Therefore, since sedf is capable of some form of best-effort
scheduling, the best thing we can do is ask for this behaviour for
dom0, as it is for all other domains, right upon creation. It will
then be the sysadmin's job to modify dom0's scheduling parameters to
better fit his particular needs, maybe after spreading the load a bit
by pinning VCPUs on PCPUs, or using cpupools, etc.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agox86/tboot: fix some coding style issues in tboot.c
Gang Wei [Mon, 2 Jan 2012 12:43:07 +0000 (12:43 +0000)]
x86/tboot: fix some coding style issues in tboot.c

Signed-off-by: Gang Wei <gang.wei@intel.com>
Acked-by: Joseph Cihula <joseph.cihula@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoUpdate the maitainer list for Intel(R) TXT
Gang Wei [Mon, 2 Jan 2012 12:42:15 +0000 (12:42 +0000)]
Update the maitainer list for Intel(R) TXT

Signed-off-by: Gang Wei <gang.wei@intel.com>
14 years agox86/passthrough: don't leak guest IRQs
Jan Beulich [Mon, 2 Jan 2012 08:26:19 +0000 (09:26 +0100)]
x86/passthrough: don't leak guest IRQs

As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must not
be called for the non-emu-IRQ case (to prevent the entire unmap
operation failing).

Based on a suggestion from Stefano.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agoX86: Add a delay between INIT & SIPIs for tboot AP bring-up in X2APIC case
Gang Wei [Thu, 29 Dec 2011 10:07:54 +0000 (10:07 +0000)]
X86: Add a delay between INIT & SIPIs for tboot AP bring-up in X2APIC case

Without this delay, Xen could not bring APs up while working with
TXT/tboot, because tboot needs some time in APs to handle INIT before
becoming ready for receiving SIPIs (this delay was removed as part of
c/s 23724 by Tim Deegan).

Signed-off-by: Gang Wei <gang.wei@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
14 years agoUpdate QEMU_TAG
Ian Jackson [Thu, 22 Dec 2011 14:49:38 +0000 (14:49 +0000)]
Update QEMU_TAG

14 years agolibxl: report failure to reboot/shutdown due to lackof PV interfaces to caller
Ian Campbell [Wed, 21 Dec 2011 10:47:30 +0000 (10:47 +0000)]
libxl: report failure to reboot/shutdown due to lackof PV interfaces to caller

This allow the caller to react as they think is appropriate. xl now prints a
message much like the library did previously, although hopefully somewhat more
informative.

Update the xl(1) man page to be similarly more informative.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: split libxl_domain_shutdown into libxl_domain_shutdown,..._reboot
Ian Campbell [Wed, 21 Dec 2011 10:47:11 +0000 (10:47 +0000)]
libxl: split libxl_domain_shutdown into libxl_domain_shutdown,..._reboot

The other integer request types which shutdown supported are not
useful. Specifically:

 * "suspend" is not usable via this interface since it requires other
   scaffolding, libxl_domain_suspend provides this already.
 * "halt" is the same as "poweroff".
 * "crash" is unused and at least Linux does not implement it. If a user
   steps forward then libxl_domain_crash is trivial to add.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: Fix, specify open mode to QEMU state file.
Anthony PERARD [Wed, 21 Dec 2011 14:47:26 +0000 (14:47 +0000)]
libxl: Fix, specify open mode to QEMU state file.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86: reduce scope of some symbols used with reset_stack_and_jump()
Jan Beulich [Wed, 21 Dec 2011 13:26:09 +0000 (14:26 +0100)]
x86: reduce scope of some symbols used with reset_stack_and_jump()

By making the macro properly advertise the use of the input symbol to
the compiler, it is no longer necessary for them to be global if
they're defined and used in just one source file.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agox86: move some function scope statics into .init.data
Jan Beulich [Wed, 21 Dec 2011 08:20:15 +0000 (09:20 +0100)]
x86: move some function scope statics into .init.data

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoflask/policy: Update example policy
Daniel De Graaf [Tue, 20 Dec 2011 18:19:53 +0000 (18:19 +0000)]
flask/policy: Update example policy

Rewrite the example policy to make it easier to understand and
demonstrate some of the security goals that FLASK can enforce.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: add libxl__domain_pvcontrol_{available,read,write}
Ian Campbell [Fri, 16 Dec 2011 09:34:46 +0000 (09:34 +0000)]
libxl: add libxl__domain_pvcontrol_{available,read,write}

Use instead of open coding.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: improve error handling when saving device model state.
Ian Campbell [Tue, 20 Dec 2011 18:14:53 +0000 (18:14 +0000)]
libxl: improve error handling when saving device model state.

Do not leak a file descriptor (fd2 when used with upstream qemu) or a file (the
save file which is leaked on failure).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: remove force parameter from libxl__devices_destroy
Roger Pau Monne [Thu, 15 Dec 2011 17:55:46 +0000 (18:55 +0100)]
libxl: remove force parameter from libxl__devices_destroy

Remove the force flag, and always use forced destruction.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: remove force parameter from libxl_domain_destroy
Roger Pau Monne [Thu, 15 Dec 2011 17:55:46 +0000 (18:55 +0100)]
libxl: remove force parameter from libxl_domain_destroy

Since a destroy is considered a forced shutdown, there's no point in
passing a force parameter. All the occurences of this function have
been replaced with the proper syntax.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: fix incorrect log message in libxl_domain_destroy
Roger Pau Monne [Thu, 15 Dec 2011 17:55:46 +0000 (18:55 +0100)]
libxl: fix incorrect log message in libxl_domain_destroy

Fix a log message that was referring to libxl_devices_dispose instead
of libxl__devices_destroy.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agohotplug: remove debug messages from NetBSD hotplug scripts
Roger Pau Monne [Thu, 15 Dec 2011 17:55:46 +0000 (18:55 +0100)]
hotplug: remove debug messages from NetBSD hotplug scripts

Remove unecessary debug messages from NetBSD hotplug scripts, left
error messages only.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: introduce libxl__wait_for_device_state
Roger Pau Monne [Thu, 15 Dec 2011 17:55:45 +0000 (18:55 +0100)]
libxl: introduce libxl__wait_for_device_state

This is a generic function, that waits for xs watches to reach a
certain state and then executes the passed helper function. Removed
wait_for_dev_destroy and used this new function instead. This
function will also be used by future patches that need to wait for
the initialization of devices before executing hotplug scripts.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: add support for image files for NetBSD
Roger Pau Monne [Fri, 30 Sep 2011 12:38:55 +0000 (14:38 +0200)]
libxl: add support for image files for NetBSD

Created a helper function to detect if the OS is capable of using
image files as phy backends. Create two OS specific files, and
changed the Makefile to choose the correct one at compile time.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86/AMD: fold redundant parameters of cpu_has_amd_erratum()
Jan Beulich [Mon, 19 Dec 2011 08:37:52 +0000 (09:37 +0100)]
x86/AMD: fold redundant parameters of cpu_has_amd_erratum()

The boolean 'osvw' indicator and 'osvw_id' can be folded - the function
can as well distinguish the non-OSVW case by checking for a negative
'osvw_id'. That way the whole variable argument list processing is only
needed on the legacy code path.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
14 years agohvmloader: Re-name xenstore key used to save VM generation ID buffer address.
Paul Durrant [Sun, 18 Dec 2011 14:40:39 +0000 (14:40 +0000)]
hvmloader: Re-name xenstore key used to save VM generation ID buffer address.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
14 years agoX86-MCE: fix a bug of xen-mceinj tool
Liu, Jinsong [Sun, 18 Dec 2011 14:40:00 +0000 (14:40 +0000)]
X86-MCE: fix a bug of xen-mceinj tool

Fix a bug of xen-mceinj tool which used to test mce by software way.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoFix grant_table v2 status mapping.
Paul Durrant [Sun, 18 Dec 2011 14:39:14 +0000 (14:39 +0000)]
Fix grant_table v2 status mapping.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoAllow VMs to query their own grant table version.
Paul Durrant [Sun, 18 Dec 2011 14:38:32 +0000 (14:38 +0000)]
Allow VMs to query their own grant table version.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
14 years agoxl.pod.1: improve documentation of FLASK commands
Daniel De Graaf [Sun, 18 Dec 2011 14:35:03 +0000 (14:35 +0000)]
xl.pod.1: improve documentation of FLASK commands

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoxsm: add checks on PCI configuration access
Daniel De Graaf [Sun, 18 Dec 2011 14:34:42 +0000 (14:34 +0000)]
xsm: add checks on PCI configuration access

PCI configuration access is allowed to any privileged domain
regardless of I/O port access restrictions; add XSM hooks for these
accesses.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoxsm: fix up dummy ops
Daniel De Graaf [Sun, 18 Dec 2011 14:34:12 +0000 (14:34 +0000)]
xsm: fix up dummy ops

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoxsm: Add missing access checks
Daniel De Graaf [Sun, 18 Dec 2011 14:33:48 +0000 (14:33 +0000)]
xsm: Add missing access checks

Actions requiring IS_PRIV should also require some XSM access control
in order for XSM to be useful in confining multiple privileged
domains. Add XSM hooks for new hypercalls and sub-commands that are
under IS_PRIV but not currently under any access checks.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoxsm: add remote_remap permission
Daniel De Graaf [Sun, 18 Dec 2011 14:33:19 +0000 (14:33 +0000)]
xsm: add remote_remap permission

The mmu_update hypercall can be used to manipulate the page tables of
a remote domain. Add a check for this in the XSM hook in addition to
the existing check on mapping pages of a remote domain.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoxsm: only log dummy override if not setting up dummy_xsm_ops
Daniel De Graaf [Sun, 18 Dec 2011 14:32:49 +0000 (14:32 +0000)]
xsm: only log dummy override if not setting up dummy_xsm_ops

The log messages from dummy overrides appear on every boot with XSM
enabled, and are just noise when filling in the dummy_xsm_ops
structure.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoxsm/flask: report memory and IO ranges in audit messages
Daniel De Graaf [Sun, 18 Dec 2011 14:32:26 +0000 (14:32 +0000)]
xsm/flask: report memory and IO ranges in audit messages

This information is useful when determining the cause of an AVC denial
caused by missing label on device memory or IRQs.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoxsm/flask: Add missing unlock on error path
Daniel De Graaf [Sun, 18 Dec 2011 14:32:06 +0000 (14:32 +0000)]
xsm/flask: Add missing unlock on error path

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
14 years agoLinux/xencommons: Use oxenstored by default when available
Ian Campbell [Fri, 16 Dec 2011 18:46:27 +0000 (18:46 +0000)]
Linux/xencommons: Use oxenstored by default when available

oxenstored is an ocaml implementation of the xenstore daemon. It is faster,
more scalable and more reliable than the C xenstored.

In particular the transaction model in oxenstored does not involve taking a
complete copy of the database and aborting on any (even non-conflicting) other
change.

There is a paper on the design and implementation of oxenstored at
http://gazagnaire.org/pub/GH09.pdf which includes a performance evaluation and
comparison with the C daemon etc.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86/emulator: workaround for AMD erratum 573
Jan Beulich [Fri, 16 Dec 2011 14:45:40 +0000 (15:45 +0100)]
x86/emulator: workaround for AMD erratum 573

The only cases where we might end up emulating fsincos (as any other
x87 operations without memory operands) are
- when a HVM guest is in real mode (not applicable on AMD)
- between two half page table updates in PAE mode (unlikely, and not
  doing the emulation here does affect only performance, not
  correctness)
- when a guest maliciously (or erroneously) modifies an (MMIO or page
  table update) instruction under emulation (unspecified behavior)

Hence, in order to avoid the erratum to cause harm to the entire host,
don't emulate fsincos on the affected AMD CPU families.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agolibxl: remove stubdom device model save file when destroying stubdom
Ian Campbell [Thu, 15 Dec 2011 16:56:21 +0000 (16:56 +0000)]
libxl: remove stubdom device model save file when destroying stubdom

/var/lib/xen/qemu-save.<domid> is created when the stub domain is started
(connected to a stubdom console) and is used to save the device model state on
suspend/migrate but never cleaned up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agooxenstored: Always log something at start of day (if logging enabled at all)
Ian Campbell [Thu, 15 Dec 2011 16:53:52 +0000 (16:53 +0000)]
oxenstored: Always log something at start of day (if logging enabled at all)

Otherwise at the default level we rarely log anything at all.

A completely empty log file is a good sign, but only if you know you are
looking in the right place...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agooxenstored: install configuration file
Ian Campbell [Thu, 15 Dec 2011 16:52:22 +0000 (16:52 +0000)]
oxenstored: install configuration file

First though:
  - Move it to /etc/xen/oxenstored.conf.
  - Use /var/run/xenstored.pid as default pid file
  - Disable test-eagain "Randomly failed a transaction with EAGAIN. Used for
    testing Xs user". Doesn't sound fun by default...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agooxenstored: handle unknown operations by returning an error to the client
Ian Campbell [Thu, 15 Dec 2011 16:50:36 +0000 (16:50 +0000)]
oxenstored: handle unknown operations by returning an error to the client

Previous an unknown operation would be decoded as a Not_found exception which
would bubble all the way up to the try ... with surrounding the call to
main_loop where it would be logged and ignored.

This would leave the guest hanging waiting for a response to the invalid
request.

Instead introduce a specific "Invalid" operation. Higher level functionality,
such as Process.process_packet, already handles operations which are not
understood with an error reply due to the final wildcard entry in
Process.function_of_type but explicitly handle Invalid this way to make it
clear what is going on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86/AMD: use correct shift count when merging model and stepping
Jan Beulich [Thu, 15 Dec 2011 13:28:45 +0000 (14:28 +0100)]
x86/AMD: use correct shift count when merging model and stepping

... for legacy errata matching.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agox86/ucode: fix for AMD Fam15 CPUs
Christoph Egger [Thu, 15 Dec 2011 10:00:09 +0000 (11:00 +0100)]
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agox86/MCE: add more strict sanity check of one SRAR case
Liu, Jinsong [Thu, 15 Dec 2011 09:58:53 +0000 (10:58 +0100)]
x86/MCE: add more strict sanity check of one SRAR case

When RIPV = EIPV = 0, it's a little bit tricky. It may be an asynchronic error, currently we have no way to precisely locate whether the error occur at guest or hypervisor.
To avoid handling error in wrong way, we treat it as unrecovered.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agox86/MCE: add SRAR handler
Liu, Jinsong [Thu, 15 Dec 2011 09:54:51 +0000 (10:54 +0100)]
x86/MCE: add SRAR handler

Currently Intel SDM add 2 kinds of MCE SRAR errors:
1). Data Load error, error code = 0x134
2). Instruction Fetch error, error code = 0x150
This patch add handler to these new SRAR errors.
It based on existed mce infrastructure, add code to handle SRAR specific error.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agoXLAT.lst whitespace fix.
Andrew Cooper [Wed, 14 Dec 2011 16:53:54 +0000 (17:53 +0100)]
XLAT.lst whitespace fix.

Replace spaces with tabs to be in line with file format.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
14 years agooxenstored: log Errors and Warnings by default.
Ian Campbell [Fri, 9 Dec 2011 16:19:36 +0000 (16:19 +0000)]
oxenstored: log Errors and Warnings by default.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agooxenstored: Remove support for PQ defined operations.
Ian Campbell [Fri, 9 Dec 2011 16:19:36 +0000 (16:19 +0000)]
oxenstored: Remove support for PQ defined operations.

It is unused.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: fix cold plugged PCI devices with stubdomains
Ian Campbell [Fri, 9 Dec 2011 12:01:16 +0000 (12:01 +0000)]
libxl: fix cold plugged PCI devices with stubdomains

Since 23565:72eafe80ebc1 the xenstore entries for the stubdomain's PCI were
never created and therefore the stubdom ends up waiting forever for the devices
which it has been asked to insert to show up.

Since the stubdomain is already running when we call the libxl_device_pci_add
loop in do_domain_create we should treat it as if "starting == 0".

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agomini-os: do not wait for pci backend in pcifront_scan
Ian Campbell [Fri, 9 Dec 2011 12:01:17 +0000 (12:01 +0000)]
mini-os: do not wait for pci backend in pcifront_scan

This blocks the main thread indefinitely if there is no PCI backend present in
xenstore.

Even in the case where there are passthrough devices configured libxl creates
the stubdom and waits for it to startup _before_ adding the backend. Since the
stub domains main thread is blocked before it can write the "running" state to
xenstore the toolstack eventually times out and kills everything.

There is already a separate pcifront thread which waits for the backend to
appear and calls init_pcifront at the appropriate time should a backend ever
appear.

Unfortunately I don't have any free test boxes with VT-d so I haven't been able
to test the cases where PCI deivces are passed through but I obviously have
tested that I can now start an HVM domain with stub qemu without PCI devices
passed through which I couldn't do before so this is an improvement. This stuff
is a bit like pushing the lump around the carpet :-/

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: do not leak qemu saved state on restore
Ian Campbell [Tue, 13 Dec 2011 15:42:18 +0000 (15:42 +0000)]
libxl: do not leak qemu saved state on restore

In particular do not leak /var/lib/xen/qemu-resume.<domid>.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agopygrub: Fix "a" entry editing in grub2
Miroslav Rezanina [Tue, 13 Dec 2011 15:39:28 +0000 (15:39 +0000)]
pygrub: Fix "a" entry editing in grub2

When user wants to change entry in grub2 menu in pygrub, there's no
response in case of appending command line arguments ('a' key).

Append malfunction is caused by change of keyword used for kernel
record. Grub uses 'kernel' for line with linux kernel but grub2 uses
'linux' instead. This patch adds checking for both grub 1 and 2 keywords.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agopygrub: Allow scrolling of the list of entries
Miroslav Rezanina [Tue, 13 Dec 2011 15:38:20 +0000 (15:38 +0000)]
pygrub: Allow scrolling of the list of entries

When user wants to change entry in grub2 menu in pygrub, there
may be crash of pygrub in case of editing item ('e' key).

Crash on editing is caused longer entry list in case of grub2. As entry
window is 10 lines high, it can hold only 8 entries (2 lines for border).
Adding line outside of windows high causes crash. Patch add handling
for longer lists and scrolling through them.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Compile with -Wformat-nonliteral.
Ian Campbell [Tue, 13 Dec 2011 15:31:12 +0000 (15:31 +0000)]
libxl: Compile with -Wformat-nonliteral.

At least one compiler (some Ubuntu version) uses this by default and it seems
like a good idea anyway and the fixup required is trivial.

One hunk is from a patch by Ian Jackson.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Adda Rathbone <addarathbone@googlemail.com>
Tested-by: Adda Rathbone <addarathbone@googlemail.com>
Tested-by: Andrew Pounce <andrew.pounce@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agostubdom: allow to build with older tool chain
Jan Beulich [Tue, 13 Dec 2011 12:32:23 +0000 (13:32 +0100)]
stubdom: allow to build with older tool chain

GNU make prior to 3.81 doesn't support $(realpath ...). This fixes a
regression introduced in 23368:0f670f5146c8 (the option tested via
cc-option-add got interpreted as the argument of the -I compiler
option, as its intended argument was blank, and hence the compiler was
falsely considered to support *any* option in the pciutils sub-tree).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoACPI: eliminate duplicate IVRS definitions
Jan Beulich [Tue, 13 Dec 2011 10:50:43 +0000 (11:50 +0100)]
ACPI: eliminate duplicate IVRS definitions

Use their proper counterparts in include/acpi/actbl*.h instead.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoACPI: eliminate duplicate DMAR definitions
Jan Beulich [Tue, 13 Dec 2011 10:49:33 +0000 (11:49 +0100)]
ACPI: eliminate duplicate DMAR definitions

Use their proper counterparts in include/acpi/actbl*.h instead.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoACPI: update table interface headers
Jan Beulich [Tue, 13 Dec 2011 10:48:08 +0000 (11:48 +0100)]
ACPI: update table interface headers

... to what is being used on Linux 3.1 (and 3.2-rc).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoACPI: eliminate duplicate MADT parsing and unused SBF definitions
Jan Beulich [Tue, 13 Dec 2011 10:46:21 +0000 (11:46 +0100)]
ACPI: eliminate duplicate MADT parsing and unused SBF definitions

Use their proper counterparts in include/acpi/actbl*.h instead.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoVT-d: bind IRQs to CPUs local to the node the IOMMU is on
Jan Beulich [Tue, 13 Dec 2011 10:38:57 +0000 (11:38 +0100)]
VT-d: bind IRQs to CPUs local to the node the IOMMU is on

This extends create_irq() to take a node parameter, allowing the
resulting IRQ to have its destination set to a CPU on that node right
away, which is more natural than having to post-adjust this (and
get e.g. a new IRQ vector assigned despite a fresh one was just
obtained).

All other callers of create_irq() pass NUMA_NO_NODE for the time being.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoremove the use of -Wno-unused-value
Jan Beulich [Tue, 13 Dec 2011 10:36:35 +0000 (11:36 +0100)]
remove the use of -Wno-unused-value

It has been hiding actual mistakes, and there are not too many changes
necessary to make things build without suppressing this warning.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agox86: remove redundant MCE related MSR definitions
Jan Beulich [Tue, 13 Dec 2011 08:50:21 +0000 (09:50 +0100)]
x86: remove redundant MCE related MSR definitions

Two definitions (the first register and a macro to calculate the
register for a given bank) are sufficient per kind of register.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>